package com.logos.service.impl;

import com.logos.dao.BookDao;
import com.logos.entity.Book;
import com.logos.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDao bookDao;


    @Override
    public void save() {
        System.out.println("save.run...");
    }

    @Override
    public boolean insert(Book book) {
        return bookDao.save(book) > 0;
    }

    @Override
    public boolean update(Book book) {
        return bookDao.update(book) > 0;
    }

    @Override
    public boolean deleteById(Integer id) {
        return bookDao.delete(id) > 0;
    }

    @Override
    public Book selectById(Integer id) {
        return bookDao.selectById(id);
    }

    @Override
    public List<Book> selectAll() {
        return bookDao.selectAll();
    }

}
